<?php
namespace app\model;

use app\model\Base;

class PageConfig extends Base
{
            /**
     *定义主键
     * @var string 
     */
    protected $pk = 'id';
    protected $autoWriteTimestamp = true;

    // 添加时间字段名
    protected $createTime = 'created_at';

    // 更新时间字段名
    protected $updateTime = 'updated_at';

        /**
     * 列表(分页)
     * @param  string/array  $where  查询条件
     * @return obj
     */
    public function listQuery(string|array $where = '')
    {
        return $this->where($where)->field('*')->order('id', 'desc')->paginate(input('limit/d'));
    }

       /**
     * 列表
     * @param  string/array  $where  查询条件
     * @param  string        $field  查询的字段
     * @return array
     */
    public function listArray(string|array $where = '', string $field = '*')
    {
        return $this->where($where)->order('id', 'desc')->column($field);
    }
}

